Component({
  data: {
    selected: 0,
    color: "#999999",
    selectedColor: "#1890ff",
    list: [{
      pagePath: "/pages/index/index",
      iconPath: "word",
      selectedIconPath: "word-active",
      text: "单词书"
    }, {
      pagePath: "/pages/farm/farm",
      iconPath: "farm",
      selectedIconPath: "farm-active",
      text: "鼠鼠农场"
    }, {
      pagePath: "/pages/my/my",
      iconPath: "my",
      selectedIconPath: "my-active",
      text: "我的"
    }]
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({url})
      this.setData({
        selected: data.index
      })
    }
  }
}) 